use serde_derive::{Deserialize, Serialize};

#[derive(Serialize, Deserialize)]
pub struct ServerInfo {
    pub port: u32,
    pub id: String,
    pub mac: String,
    pub version: String,
}

#[derive(Serialize, Deserialize)]
pub struct TokenResponse {
    pub result: bool,
    pub token: String,
}

#[derive(Serialize, Deserialize)]
pub struct SystemStatus {
    pub camera_rgb: i32,
    pub battery: i32,
    pub camera_processed: i32,
    pub imu: i32,
    pub odom: i32,
    pub camera_depth: i32,
    pub driver_port: bool,
    pub charge: bool,
    #[serde(rename = "loop")]
    pub loop_flag: bool,
}

#[derive(Serialize, Deserialize)]
pub struct Pose {
    pub x: f32,
    pub y: f32,
    pub angle: f32,
}

#[derive(Serialize, Deserialize)]
pub struct TargetPose {
    pub x: f32,
    pub y: f32,
    pub theta: f32,
}

#[derive(Serialize, Deserialize)]
pub struct SetSpeedReq {
    pub speed_x: f32,
    pub speed_y: f32,
    pub speed_angle: f32,
}

#[derive(Serialize, Deserialize)]
pub struct TaskInfo {
    pub id: String,
    pub state: TaskState,
}

#[derive(Serialize, Deserialize)]
pub enum TaskState {
    WAITTING,
    WORKING,
    PAUSED,
    CANCELLED,
    ERROR,
    COMPLETE
}

